; procedure fMultProc(Operand1, Operand2 : float;
;                     Result : address of float)
; parameters are passed in doublewords on the stack
; parameters are removed by the procedure
; author:  R. Detmer  4/98

.DATA
sign1      BYTE  ?
exponent1  WORD  ?
fraction1  DWORD ?
sign2      BYTE  ?
exponent2  WORD  ?
fraction2  DWORD ?
sign3      BYTE  ?
exponent3  WORD  ?
fraction3  DWORD ?

.CODE
fMultProc  PROC NEAR32
           push    ebp            ; save base pointer
           mov     ebp,esp        ; copy stack pointer
           push    eax            ; save registers
           push    edx

           expand  [ebp+16], sign1, exponent1, fraction1
           expand  [ebp+12], sign2, exponent2, fraction2
           mov     al, sign1      ; combine signs
           xor     al, sign2
           mov     sign3, al      ; and save
           mov     ax, exponent1  ; add exponents
           add     ax, exponent2
           mov     exponent3, ax  ; and save
           mov     eax, fraction1 ; multiply fractions
           mul     fraction2
           shrd    eax, edx, 23   ; discard extra bits
           mov     fraction3, eax ; and save

           normalize sign3, exponent3, fraction3
           mov     edx, [ebp+8]   ; address for result
           combine [edx], sign3, exponent3, fraction3

           pop    edx             ; restore registers
           pop    eax 
           pop    ebp             ; restore base pointer
           ret    12              ; return, removing parameters
fMultProc  ENDP

